package com.jh3502.helper.function.person.personlist;

import com.jh3502.helper.base.BaseCallback;
import com.jh3502.helper.base.BaseJson;
import com.jh3502.helper.base.BasePresenter;
import com.jh3502.helper.base.BaseView;

import java.util.Map;

/**
 * @author harisucici
 * @date 2017/6/19
 */

public class PersonListPresenter extends BasePresenter {
    PersonListModel mPersonListModel;

    PersonListView mPersonListView;

    public void setPersonListView(PersonListView mPersonListView) {
        this.mPersonListView = mPersonListView;
    }

    //  保存数据
    public void toSaveoneall(Map<String, Object> body) {
        mPersonListView.showLoadingDialog();
        if (mPersonListModel == null) {
            mPersonListModel = new PersonListModel(mPersonListView.getActContext());
        }

        mPersonListModel.saveoneall(body, new BaseCallback(mPersonListView) {
            @Override
            public void responseSuccess(BaseJson baseJson) {
                mPersonListView.saveoneallSuccess();
            }


        });
    }


    @Override
    public void cancelCall() {

    }

    public interface PersonListView extends BaseView {
        void saveoneallSuccess();

    }
}
